<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  		<link rel="stylesheet" href="${resource(dir:'css',file:'jquery-ui-1.10.2.custom.min.css')}" />
	    <script src="${resource(dir:'js',file:'jquery-1.9.1.min.js')}"></script>
	    <script src="${resource(dir:'js',file:'jquery-ui-1.10.2.custom.min.js')}"></script>
        <meta name="layout" content="main" />
        <g:set var="entityName" value="${message(code: 'partner.label', default: 'Partner')}" />
        <title><g:message code="default.show.label" args="[entityName]" /></title>
        <script>
		  $(function() {
		    $( "#tabs" ).tabs();
		    reloadAll();
		  });

		  var auto_refresh = setInterval(
			  function () {
			  	$('#tabs-1').load('newOrders').fadeIn("slow");
			  }, 10000);

		  function processNewOrder(handleType, orderId) {
				var path = "processNewOrder?orderId=" + orderId + "&handleType=" + handleType
				$.ajax({
					  url: path,
					  context: document.body
					}).done(function() {
						reloadAll()
					});
		  }

		  function reloadAll() {
			  $('#tabs-1').load('newOrders').fadeIn("slow");
			  $('#tabs-2').load('confirmedOrders').fadeIn("slow");
			  $('#tabs-3').load('deliveredOrders').fadeIn("slow");
			  $('#tabs-4').load('finishedOrders').fadeIn("slow");
			  $('#tabs-5').load('cancelledOrders').fadeIn("slow");
		  }
		</script>
    </head>
    <body>
	    <div id="tabs">
		  <ul>
		    <li><a href="#tabs-1">未确认</a></li>
		    <li><a href="#tabs-2">已确认</a></li>
		    <li><a href="#tabs-3">已送出</a></li>
		    <li><a href="#tabs-4">已完成</a></li>
		    <li><a href="#tabs-5">取消</a></li>
		  </ul>
		  <div id="tabs-1">
		  </div>
		  <div id="tabs-2">
		  </div>
		  <div id="tabs-3">
		  </div>
		  <div id="tabs-4">
		  </div>
		  <div id="tabs-5">
		  </div>
		</div>
    </body>
</html>
